<h1><span class="allstores_ico"></span><?= $sname = $trade->title; echo  ' '. lang('label_search_result') ?></h1>

<ul class="breadcrumb">
    <li><a href="<?= base_url() ?>"><?= lang('label_home') ?></a></li>
    <li><a href="javascript:void(0)"><?= $sname ?></a></li>
    <li><?= lang('label_search_result') ?></li>
</ul>
<div class="page">
    <?php if ($products) { ?>
        <ul class="product_list">
            <?php foreach ($products as $product) { ?>
                <li>
                    <a href="<?= base_url('products/view/' . $product->id) ?>">
                        <span>
                            <img src="<?php
                            $images = unserialize($product->images);
                            if (count($images) > 0) {
                                foreach ($images as $k => $v) {
                                    if ($v[1] == 'yes') {
                                        $nodef = false;
                                        $defimage = $v[0];
                                        echo base_url(PRODUCT_PATH . $v[0]);
                                    }
                                } if ($nodef) {
                                    base_url(PRODUCT_PATH . $images[0][0]);
                                    $defimage = $images[0][0];
                                }
                            } else {
                                echo str_replace('/index.php', '', $_SERVER['SCRIPT_NAME']) . '/' . APPPATH . 'views/' . $this->themes->Cms_themes() . '/images/noimage_' . LANG . '.gif';
                            }
                            ?>" alt="" />
                            <samp><?= lang('label_rial') ?><br /><b><?= ($product->discount_precentage > 0) ? $product->discount_price : $product->price; ?></b></samp>
                        </span>
                        <h5><?= $product->name ?></h5>
                    </a>
                </li>

            <?php } ?>
        </ul>
    <?php } else { ?>
        <div class="unsaved">
            <img src="<?php echo str_replace('/index.php', '', $_SERVER['SCRIPT_NAME']) ?>/<?php echo APPPATH ?>views/<?php echo $this->themes->Cms_themes() ?>/images/noproduct.png" alt="" />
            <div style="margin-top: -75px"><?= lang('message_no_products') ?></div>
        </div>
        <br /><br /><br /><br />
    <?php } ?>
</div>